<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 5/20/24
 * Time: 4:29 PM
 */

namespace App\Http\Resources;

use Illuminate\Pagination\LengthAwarePaginator;

class PaginatorResource extends LengthAwarePaginator
{
    public function toArray()
    {
        return [
            'total'        => $this->total(),
            'per_page'     => $this->count(),
            'current_page' => $this->currentPage(),
            'last_page'    => $this->lastPage(),
            'list'         => $this->items->toArray(),
        ];
    }
}
